package models;

import edu.stanford.nlp.tagger.maxent.MaxentTagger;

public class TaggerModel {
	
	private MaxentTagger tagger = null;
	
	private static TaggerModel instance = null;
	
	public static TaggerModel getInstance() {
		if (instance == null) {
			instance = new TaggerModel();
		}
		
		return instance;
	}
	
	private TaggerModel() {
		try {
			tagger = new MaxentTagger("taggers/english-left3words-distsim.tagger");
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	
	public static void resetInstance() {
			instance = new TaggerModel();
	}
	
	public String getTags(String content) {
		String tags = "";
		
		// The tagged string
        String tagged = tagger.tagString(content);
		
		return tagged;
	}
}
